package com.template.app.exception;

import java.io.Serializable;

import com.template.app.i18n.I18N;
import com.template.app.i18n.I18NKey;
import com.template.app.util.Utils;

public class ObjectNotFoundException extends AppException {

	private static final long serialVersionUID = 1L;

	private Class<?> clazz;
	private Serializable id;
	
	public ObjectNotFoundException(Class<?> clazz, Serializable id) {
		this.clazz = clazz;
		this.id = id;
	}
	
	@Override
	public String getMessage() {
		return I18N.getString(I18NKey.OBJECT_NOT_FOUND_MESSAGE) + " " +
				I18N.getString(Utils.firstToLower(clazz.getSimpleName())) + "[" + id.toString() + "]";
	}

}
